<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box{
      width: 100px;
      height: 100px;
      background-color: pink;
    }
  </style>
</head>
<body>
  <div class="box" id="box"></div>
  <script src="./jquery-1.12.4.min.js"></script>
  <script>
    // 获取元素
    // var box = document.getElementById("box");
    // var div = document.getElementsByTagName("div")[0];

    // jq获取
    $(".box");
    $("#box");

    // 获取css样式
    console.log($(".box").css("width"));
    console.log($(".box").css("height"));
    console.log($(".box").css("background-color"));

    // 设置css样式
    console.log($(".box").css("width",500));
    $("#box").click(function () {
      console.log(111);
      console.log($(this).css("width",250));
    });

    // 运动
    $("#box").animate({
      width : 2000,
    },1000)
  </script>
</body>
</html>